//
//  SISSExcelContentTableViewCell.m
//  SISSAPP
//
//  Created by 袁应荣 on 2018/8/6.
//  Copyright © 2018年 优房网. All rights reserved.
//

#import "SISSExcelContentTableViewCell.h"

@implementation SISSExcelContentTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self initUI];
    [self initConstraint];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self initUI];
        [self initConstraint];
    }
    return self;
}

- (void)initUI {
    
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.itemSize = CGSizeMake((SCREEN_WIDTH - 4) * 0.25, 44);
    flowLayout.minimumLineSpacing = 1;
    flowLayout.minimumInteritemSpacing = 1;
    
    [flowLayout setScrollDirection:UICollectionViewScrollDirectionHorizontal];
    //设置CollectionView的属性
    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:self.contentView.bounds collectionViewLayout:flowLayout];
    collectionView.scrollEnabled = YES;
    collectionView.alwaysBounceHorizontal = NO;
    collectionView.showsHorizontalScrollIndicator = NO;
    collectionView.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:collectionView];
    self.contentCollectionView = collectionView;
}

- (void)initConstraint {
    WeakSelf
    [self.contentCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(weakSelf.contentView);
    }];
}


@end
